<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
   <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>超市账单管理系统</title>
    <link rel="stylesheet" href="css/public.css"/>
    <link rel="stylesheet" href="css/style.css"/>
        <script type="text/javascript" src="js/jQuery-1.8.3.js"></script>
</head>
<c:if test="${! empty fankui }">
<script type="text/javascript">
alert("${fankui}");
</script>
<c:remove var="fankui"/>
</c:if>

<body>
<%@include file="head.jsp" %>
        <div class="right">
            <div class="location">
                <strong>你现在所在的位置是:</strong>
                <span>密码修改页面</span>
            </div>
            <div class="providerAdd">
                <form action="updatepass.csdd" id="passfo">
                    <!--div的class 为error是验证错误，ok是验证成功-->
                    <div class="">
                        <label for="oldPassword">旧密码：</label>
                        <input type="password" name="oldPassword" id="oldPassword" required/>
                        <span>*请输入原密码</span>
                    </div>
                    <div>
                        <label for="newPassword">新密码：</label>
                        <input type="password" name="newPassword" id="newPassword" required/>
                        <span >*请输入新密码</span>
                    </div>
                    <div>
                        <label for="reNewPassword">确认新密码：</label>
                        <input type="password" name="reNewPassword" id="reNewPassword" required/>
                        <span >*请输入新确认密码，保证和新密码一致</span>
                    </div>
                    <div class="providerAddBtn">
                        <!--<a href="#">保存</a>-->
                        <input type="button" value="保存"  id="tijiao"/>
                    </div>
                </form>
            </div>
        </div>
    </section>
    <footer class="footer">
        版权归北大青鸟
    </footer>
<script src="js/time.js"></script>
<!-- 验证原密码是否正确 -->
<script type="text/javascript">
$(function(){

$("#oldPassword").blur(function(){
if(this.value=="${user.userPassword}"){
$("#oldPassword").next().html("与原密码匹配");
}else{
$("#oldPassword").next().html("请输入原密码");
}
});

$("#tijiao").click(function(){
  if($("#reNewPassword").val()==$("#newPassword").val()){
$("#reNewPassword").next().html("√");
$("#passfo").submit();	
}else{
$("#reNewPassword").next().html("两次密码输入不一样");
return false;
}

});
});

</script>
</body>
</html>